﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="viewCart.ascx.cs" Inherits="user_ViewCart" %>
<link href="../css/styles.css" rel="stylesheet" type="text/css" />
<asp:GridView ID="grvCart" runat="server" AutoGenerateColumns="False" OnRowCommand="grvCart_RowCommand"
    DataKeyNames="PdID" ShowFooter="True" OnRowDataBound="grvCart_RowDataBound" Width="740px"
    EmptyDataText="&nbsp;Shopping cart empty" FooterStyle-HorizontalAlign="Right"
    CellPadding="7" GridLines="None" CssClass="gridviewcart">
    <AlternatingRowStyle BackColor="#EBEBEB" />
    <Columns>
        <asp:TemplateField HeaderText="Image">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" Width="100" Height="100" ImageUrl='<%#Eval("Image")%>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="ProductName" HeaderText="Product Name" />
        <asp:TemplateField HeaderText="Quantity">
            <ItemTemplate>
                <asp:TextBox ID="txtQuantity" runat="server" Width="50" Text='<%#Eval("Quantity")%>'></asp:TextBox>
                <br />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" DataFormatString="{0:0.0.0} $" />
        <asp:BoundField DataField="TotalPrice" HeaderText="Total Price" DataFormatString="{0:0.0.0} $" />
        <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="remove" CommandArgument='<%#Eval("PdID") %>'>Delete</asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <FooterStyle HorizontalAlign="Right"></FooterStyle>
    <HeaderStyle BackColor="#E5E5E5" HorizontalAlign="Left" />
    <RowStyle BackColor="White" />
</asp:GridView>
<p style="float: left; margin: 5px;">
    <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/user/default.aspx">Continue choose item</asp:LinkButton></p>
<p style="float: right; margin: 5px;">
    <asp:Button ID="btnCheckout" runat="server" Text="Check out" OnClick="btnCheckout_Click" />
</p>
<p style="float: right; margin: 5px;">
    <asp:Button ID="btnUpdateCart" runat="server" Text="Update Your cart" OnClick="btnUpdateCart_Click" />
</p>
